package com.igs.muziapp;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleAdapter;

public class RegisterClause extends Activity {

	private ListView LView;
	private ArrayList<HashMap<String, Object>> list = new ArrayList<HashMap<String, Object>>();
	private SimpleAdapter adapter;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_register_clause);

		HashMap<String, Object> item = new HashMap<String, Object>();
		item.put("img", R.drawable.mb_app_p002_coin_001);
		item.put("btn", "按鍵1");
		item.put("edt", "編輯1");
		list.add(item);

		adapter = new SimpleAdapter(this, list, R.layout.list_testview, new String[] { "img", "btn", "edt" }, new int[] { R.id.imageView1, R.id.button1, R.id.editText1 });
		LView = (ListView) findViewById(R.id.listView1);
		LView.setAdapter(adapter);

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_register_clause, menu);
		return true;
	}

	// public class MySimpleAdapter extends SimpleAdapter {
	// private int mResource;
	// private LayoutInflater mInflater;
	//
	// public MySimpleAdapter(Context context, List<? extends Map<String, ?>>
	// data, int resource, String[] from, int[] to) {
	// super(context, data, resource, from, to);
	// mResource = resource;
	// mInflater = (LayoutInflater)
	// context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	// // TODO Auto-generated constructor stub
	// }
	//
	// @Override
	// public View getView(int position, View convertView, ViewGroup parent) {
	// View v;
	// if (convertView == null) {
	// v = mInflater.inflate(mResource, parent, false);
	// } else {
	// v = convertView;
	// }
	// return v;
	// }
	// }

}
